com.supermap.mapping.dyn
Class DynamicElement
- java.lang.Object
-
- com.supermap.mapping.dyn.DynamicElement
-
- Direct Known Subclasses:
- DynamicChart, DynamicCircle, DynamicLine, DynamicPoint, DynamicPolygon, DynamicText
public abstract class DynamicElement extends java.lang.Object
The base class of the dynamic object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
DynamicElement.ElementType
The dynamic element type.static interface
DynamicElement.OnClickListener
The listener of dynamic data click event.static interface
DynamicElement.OnDownAndUpListener
The OnDownAndUpListener for dynamic datastatic interface
DynamicElement.OnLongPressListener
The listener of dynamic data long-click event.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description void
addAnimator(Animator animator)
Adds the animation to the dynamic element.void
addPoint(Point2D pt)
Adds the point.void
addPoints(Point2Ds ps)
Add point setvoid
dispose()
Disposes resources.abstract boolean
fromGeometry(Geometry geometry)
Create the dynamic data through Geometry.Rectangle2D
getBounds()
Gets the range of dynamic object.Point2Ds
getGeoPoints()
Gets the tuples.int
getID()
Gets the ID of dynamic object.double
getMinShowScale()
Gets the minimum display scale.java.lang.String
getName()
Gets the name of the dynamic object, and the default problem null.int
getNameColor()
Gets the name font color.float
getNameOffsetX()
float
getNameOffsetY()
Gets the Y offset of the name text.Point2D
getNamePosition()
Gets the location coordinates of the name text, and if the user does not have the setting, the object center point is adopted by default.float
getNameSize()
Gets the name font size.DynamicAlignment
getNameTextAlign()
Gets the name text to its method, the default center alignment.DynamicElement.OnDownAndUpListener
getOnDownAndUpListener()
Gets the listener OnDownAndUpListener of the objectDynamicElement.OnLongPressListener
getOnLongPressListener()
Gets the long-click listening of this objectjava.util.ArrayList<java.lang.Integer>
getPart()
Gets the point string group info.DynamicStyle
getStyle()
Gets the style.java.lang.String
getTag()
Gets the label.DynamicElement.ElementType
getType()
Gets the type.java.lang.Object
getUserData()
Gets the user data.boolean
isNameVisible()
Gets whether the dynamic object name is visible, and the default false.void
setMinShowScale(double scale)
Sets the minimum display scale.void
setName(java.lang.String name)
Sets the name of a dynamic object.void
setNameColor(int color)
Sets name font color, default blackvoid
setNameOffsetX(float offsetX)
Sets the X offset of the name text.void
setNameOffsetY(float offsetY)
Sets the Y offset of the name text.void
setNamePosition(Point2D position)
Sets the location of the name text.void
setNameSize(float size)
Sets name font size default 16pixel.void
setNameTextAlign(DynamicAlignment align)
Sets the name text to its method, the default center alignment.void
setNameVisible(boolean visible)
Sets whether the dynamic object name is visible, and is not visible by default.void
setOnClickListenner(DynamicElement.OnClickListener listener)
Sets the clicking listener.void
setOnDownAndUpListener(DynamicElement.OnDownAndUpListener listener)
Sets the listeners as fingers press down or leave dynamic objects.void
setOnLongPressListener(DynamicElement.OnLongPressListener listener)
Sets the long-click listener.void
setStyle(DynamicStyle style)
Sets the style.void
setTag(java.lang.String tag)
Sets the label.void
setUserData(java.lang.Object data)
Sets the user data.void
updatePoint(int index, Point2D pt)
Updates the point.
-
-
-
Method Detail
-
setStyle
public void setStyle(DynamicStyle style)
Sets the style.- Parameters:
style
- The style.
-
setUserData
public void setUserData(java.lang.Object data)
Sets the user data.- Parameters:
data
- The user data.
-
getUserData
public java.lang.Object getUserData()
Gets the user data.- Returns:
- The user data.
-
getStyle
public DynamicStyle getStyle()
Gets the style.- Returns:
- The style of the dynamic object.
-
getType
public DynamicElement.ElementType getType()
Gets the type.- Returns:
- The type of dynamic object.
-
getGeoPoints
public Point2Ds getGeoPoints()
Gets the tuples.- Returns:
- The point string of dynamic object.
-
getPart
public java.util.ArrayList<java.lang.Integer> getPart()
Gets the point string group info.- Returns:
- The point string group info.
-
getID
public int getID()
Gets the ID of dynamic object.- Returns:
- The ID of dynamic object.
-
getBounds
public Rectangle2D getBounds()
Gets the range of dynamic object.- Returns:
- The border extent.
-
setOnClickListenner
public void setOnClickListenner(DynamicElement.OnClickListener listener)
Sets the clicking listener.- Parameters:
listener
- Click listener.
-
addPoint
public void addPoint(Point2D pt)
Adds the point.- Parameters:
pt
- Added points.
-
updatePoint
public void updatePoint(int index, Point2D pt)
Updates the point.- Parameters:
index
- Indexpt
- New Point coordinates
-
addAnimator
public void addAnimator(Animator animator)
Adds the animation to the dynamic element. It can add mutiple animation.- Parameters:
animator
- Dynamic element Animation
-
fromGeometry
public abstract boolean fromGeometry(Geometry geometry)
Create the dynamic data through Geometry.- Parameters:
geometry
- Geographic elements- Returns:
- A boolean, Returns true if the constructor successful; Otherwise false.
-
setMinShowScale
public void setMinShowScale(double scale)
Sets the minimum display scale.- Parameters:
scale
- Sets the minimum display scale.
-
getMinShowScale
public double getMinShowScale()
Gets the minimum display scale.- Returns:
- The minimum display scale.
-
setOnLongPressListener
public void setOnLongPressListener(DynamicElement.OnLongPressListener listener)
Sets the long-click listener.- Parameters:
listener
- long-click listener.
-
getOnLongPressListener
public DynamicElement.OnLongPressListener getOnLongPressListener()
Gets the long-click listening of this object- Returns:
- The long-click listener.
-
setTag
public void setTag(java.lang.String tag)
Sets the label.- Parameters:
tag
- Label.
-
getTag
public java.lang.String getTag()
Gets the label. Default value is null- Returns:
- Label.
-
setName
public void setName(java.lang.String name)
Sets the name of a dynamic object.- Parameters:
name
- Name
-
getName
public java.lang.String getName()
Gets the name of the dynamic object, and the default problem null.- Returns:
- Name
-
setNameVisible
public void setNameVisible(boolean visible)
Sets whether the dynamic object name is visible, and is not visible by default.- Parameters:
visible
- Whether it is visible.
-
isNameVisible
public boolean isNameVisible()
Gets whether the dynamic object name is visible, and the default false.- Returns:
- Whether it is visible.
-
setNameColor
public void setNameColor(int color)
Sets name font color, default black- Parameters:
color
- The color value.
-
setNameSize
public void setNameSize(float size)
Sets name font size default 16pixel.- Parameters:
size
- The size text.
-
getNameColor
public int getNameColor()
Gets the name font color.- Returns:
- The color value.
-
getNameSize
public float getNameSize()
Gets the name font size.- Returns:
- The name font size.
-
setNameTextAlign
public void setNameTextAlign(DynamicAlignment align)
Sets the name text to its method, the default center alignment.- Parameters:
align
- Alignment
-
getNameTextAlign
public DynamicAlignment getNameTextAlign()
Gets the name text to its method, the default center alignment.- Returns:
- Alignment
-
setNamePosition
public void setNamePosition(Point2D position)
Sets the location of the name text.- Parameters:
position
- Position coordinates, using map coordinates.
-
getNamePosition
public Point2D getNamePosition()
Gets the location coordinates of the name text, and if the user does not have the setting, the object center point is adopted by default.- Returns:
- Returns the position coordinate point Point2D, using the map coordinates.
-
dispose
public void dispose()
Disposes resources.
-
setNameOffsetX
public void setNameOffsetX(float offsetX)
Sets the X offset of the name text.- Parameters:
offsetX
- Position offset
-
getNameOffsetX
public float getNameOffsetX()
- Parameters:
offsetX
- Gets the X offset of the name text.- Returns:
- The X offset.
-
setNameOffsetY
public void setNameOffsetY(float offsetY)
Sets the Y offset of the name text.- Parameters:
offsetY
- Position offset
-
getNameOffsetY
public float getNameOffsetY()
Gets the Y offset of the name text.- Returns:
- The Y offset.
-
getOnDownAndUpListener
public DynamicElement.OnDownAndUpListener getOnDownAndUpListener()
Gets the listener OnDownAndUpListener of the object- Returns:
- OnDownAndUpListener the listener
-
setOnDownAndUpListener
public void setOnDownAndUpListener(DynamicElement.OnDownAndUpListener listener)
Sets the listeners as fingers press down or leave dynamic objects.- Parameters:
listener
- the listener for pressing down or leaving dynamic objects.
-
addPoints
public void addPoints(Point2Ds ps)
Add point set- Parameters:
pt
-
-
-